#
#  Be sure to run `pod spec lint ios-swift-imbroker.podspec' to ensure this is a
#  valid spec and to remove all comments including this before submitting the spec.
#
#  To learn more about Podspec attributes see https://guides.cocoapods.org/syntax/podspec.html
#  To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#

Pod::Spec.new do |spec|

# spec的名字，同podfile中指定依赖的名字一致。
spec.name         = "ios-swift-imui"
# 版本号，同podfile中指定依赖的版本号一致。
spec.version      = "1.0.1"
spec.summary      = "iOS-imui"

# 描述，一般要比summary长度长些，否则pod lint时会有警告。非强制性。
spec.description  = <<-DESC
						iOS-imuit介绍。
					DESC
# 主页地址，一般指向github地址即可
spec.homepage     = "http://gitcode.lietou.com/dev28/framework/ios/ios-swift-imui.git"
# 截图，一般不需要
# spec.screenshots  = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
# 许可证，一般为MIT或BSD 3-clause,默认MIT即可
spec.license      = "MIT"
# 指定许可证的另一种方式
# spec.license      = { :type => "MIT", :file => "FILE_LICENSE" }
# 作者介绍 左边为名字，邮编为联系方式或者主页
spec.author             = { "xuwc" => "xuwc@liepin.com" }
# 指定使用系统平台
# spec.platform     = :ios
# 指定使用系统平台以及系统版本号
spec.platform     = :ios, "8.0"
# 是否采用arc，一般默认为true
spec.requires_arc = true
# 指定经爱哭使用方式，一般swift必须指定该项为true
spec.static_framework = true
# 指定swift版本号
spec.swift_version = '5.0'
# 指定module名字，一般swift使用时必须指定,注意不能使用-，要改为下划线_
spec.module_name   = 'ios_swift_imui'

# 当使用多个平台时，可如下指定，一共就4个平台。ios,osx,watchos,tvos
# spec.ios.deployment_target = "5.0"
# spec.osx.deployment_target = "10.7"
# spec.watchos.deployment_target = "2.0"
# spec.tvos.deployment_target = "9.0"

# 指定核心依赖库，开启后，仅加载指定的子库
# spec.default_subspecs = 'Core', 'UI'

# 下载资源远程仓库路径，tag为版本号，可手动指定，也可与spec版本保持一致。
spec.source       = { :git => "http://gitcode.lietou.com/dev28/framework/ios/ios-swift-imui.git", :tag => "#{spec.version}" }
# 类资源文件，为ios-swift-tools.git根目录算起,一般为这样设置即可
spec.source_files  = "classes/*"
# 非下载的文件集合，一般用于readme.md等无需下载的资源使用
#spec.exclude_files = "Classes/Exclude"

# 对外开放的头文件
spec.public_header_files = "classes/ios_swift_imui.h"
# 私有文件，不暴露给外界使用
#spec.private_header_files = "Classes/nimclient/*.h"

# 资源文件路径，此资源被直接使用
# spec.resource  = "icon.png"
# spec.resources = "Resources/**/*.png"

# 资源文件指定，会被打包成bundle文件，使用资源时需要指定bundle名字, 一般采用这种
# spec.resource_bundles = {
#     'ios-swift-tools' => ['Resources/**/*]
# }

# spec.preserve_paths = "FilesToSave", "MoreFilesToSave"

# 系统动态库依赖方式
# spec.framework  = "SomeFramework"
# spec.frameworks = "SomeFramework", "AnotherFramework"

# 系统静态库依赖方式
# spec.library   = "iconv"
# spec.libraries = "iconv", "xml2"

# 本地提供的静态库依赖方式
# spec.vendored_libraries = "Classes/**/*.a"

# 本地提供的动态库依赖方式
# subspec.ios.vendored_frameworks = "Classes/**/*.framework"

# 修改工程配置
# spec.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }

# 依赖其他第三方库
# spec.dependency "JSONKit", "~> 1.4"

# oc与swift混编，提供预编译头文件引用。
# spec.prefix_header_contents = '#import "xxx.h"', '#import <UIKit/UIKit.h>'

# *******
# 将oc文件开放给swift使用，需要在Classes类下面创建ios_swift_nimclient.h空文件，否则swift将无法找到该方法
# *******

# 子库创建方式
spec.subspec 'imui' do |imui|

    imui.source_files = 'classes/imui/*'
    imui.public_header_files = 'classes/imui/*.h'
    imui.frameworks = 'UIKit','QuartzCore'
    imui.libraries = "c++"

    imui.subspec 'base' do |base|
        base.source_files = 'classes/imui/base/*.{swift,h,m}'
        base.public_header_files = 'classes/imui/base/*.{h}'
    end

    imui.subspec 'chatcell' do |chatcell|
        chatcell.source_files = 'classes/imui/chatCell/*.{swift,h,m}'
        chatcell.public_header_files = 'classes/imui/chatCell/*.{h}'
        chatcell.prefix_header_contents = '#import "MLEmojiLabel.h"','#import "TTTAttributedLabel.h"'

        chatcell.subspec 'extensioncell' do |extensioncell|
            extensioncell.source_files = 'classes/imui/chatCell/extensionCell/*.{swift,h,m}'
            extensioncell.public_header_files = 'classes/imui/chatCell/extensionCell/*.{h}'
        end
    end

    imui.subspec 'chatpagetemplate' do |chatpagetemplate|
        chatpagetemplate.source_files = 'classes/imui/chatPageTemplate/*.{swift,h,m}'
        chatpagetemplate.public_header_files = 'classes/imui/chatPageTemplate/*.{h}'

        chatpagetemplate.subspec 'imuichat' do |imuichat|
            imuichat.source_files = 'classes/imui/chatPageTemplate/LPIMUIChat/*.{swift,h,m}'
            imuichat.public_header_files = 'classes/imui/chatPageTemplate/LPIMUIChat/*.{h}'
        end

        chatpagetemplate.subspec 'imuiconversation' do |imuiconversation|
            imuiconversation.source_files = 'classes/imui/chatPageTemplate/LPIMUIConversation/*.{swift,h,m}'
            imuiconversation.public_header_files = 'classes/imui/chatPageTemplate/LPIMUIConversation/*.{h}'
        end
    end

    imui.subspec 'tools' do |tools|
        tools.source_files = 'classes/imui/tools/*.{swift,h,m}'
        tools.public_header_files = 'classes/imui/tools/*.{h}'

        tools.subspec 'imagescaleView' do |imagescaleView|
            imagescaleView.source_files = 'classes/imui/tools/LPImageScaleView/*.{h,m}'
            imagescaleView.public_header_files = 'classes/imui/tools/LPImageScaleView/*.{h}'
            imagescaleView.prefix_header_contents = '#import "LPImageScaleView.h"','#import "LPPictureImageView.h"'

        end

        tools.subspec 'imuichatinputview' do |imuichatinputview|
            imuichatinputview.source_files = 'classes/imui/tools/LPIMUIChatInputView/*.{swift,h,m}'
            imuichatinputview.public_header_files = 'classes/imui/tools/LPIMUIChatInputView/*.{h}'
            imuichatinputview.prefix_header_contents = '#import "UITextView+LPPlaceholderExtension.h"','#import "LPChatRecordView.h"'
        end

        tools.subspec 'emvoiceconvert' do |emvoiceconvert|
            emvoiceconvert.source_files = 'classes/imui/tools/EMVoiceConvert/*.{h,m}'
            emvoiceconvert.public_header_files = 'classes/imui/tools/EMVoiceConvert/*.{h}'

            emvoiceconvert.subspec 'internal' do |internal|
                internal.source_files = 'classes/imui/tools/EMVoiceConvert/internal/*.{h,m}'
                internal.public_header_files = 'classes/imui/tools/EMVoiceConvert/internal/*.{h}'
                internal.prefix_header_contents = '#import "EMCDDeviceManagerDelegate.h"','#import "EMCDDeviceManager.h"'
            end

            emvoiceconvert.subspec 'voiceconvert' do |voiceconvert|
                voiceconvert.source_files = 'classes/imui/tools/EMVoiceConvert/VoiceConvert/**/*.{h,m,mm}'
                # ssss.public_header_files = 'Pod/Classes/LPIMUI/tools/EMVoiceConvert/VoiceConvert/**/*.{h}'
                voiceconvert.private_header_files = 'classes/imui/tools/EMVoiceConvert/VoiceConvert/**/*.{h}'
                voiceconvert.prefix_header_contents = '#import "EMVoiceConverter.h"'
            end

            emvoiceconvert.vendored_libraries = 'classes/imui/tools/EMVoiceConvert/Frameworks/libopencore-amrnb.a','classes/LPIMUI/tools/EMVoiceConvert/Frameworks/libopencore-amrwb.a'

        end

        tools.subspec 'emoji' do |emoji|
            emoji.source_files = 'classes/imui/tools/LPEmoji/*.{h,m,swift}'
            emoji.public_header_files = 'lasses/imui/tools/LPEmoji/*.h'
            emoji.prefix_header_contents = '#import "LPEmoji.h"'
        end
    end

    imui.dependency 'ios-swift-tools'
	imui.dependency 'ios-swift-dbclient'
	imui.dependency 'ios-swift-base'
	imui.dependency 'ios-swift-nimclient'
	imui.dependency 'ios-swift-standardui'
    imui.dependency 'SnapKit'
    imui.dependency 'ios-swift-httpclient'
    imui.dependency 'ios-swift-pullrefresh'
    


	imui.resource_bundles = {
      'ios-swift-imui' => ['assets/**/*.{png,plist}']
 	}

end
end

